package com.mst;

import com.mst.domain.Student;
import com.mst.domain.User;
import com.mst.service.IStudentService;
import com.mst.service.IUserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringConfig.class)
public class AopT {
    @Autowired
    private IStudentService studentService;
    @Autowired
    private IUserService userService;

    @Test
    public void testStudentService() {
        Student student = new Student("张三");
        studentService.addStudent(student);
//        throw new RuntimeException();
    }

    @Test
    public void testUserService() {
        User user = new User("李四");
        userService.addUser(user);
    }
}
